<template>
    <el-input v-model="name"/>
    <Son :name="name" :age="age" @pMsg="getMsg"/>
</template>

<script>
import { ref } from 'vue'
import Son from './son.vue'

export default {
  name: 'props',
  components: { Son },
  setup () {
    const name = ref('leyo')
    const age = ref(18)
    const getMsg = (value) => {
      console.log('接收子组件信息', value)
    }
    return {
      name,
      age,
      getMsg
    }
  }
}

</script>
